<template>
  <div id="app" @touchstart="touchstart" @touchend="touchend">
    <router-view />
  </div>
</template>
<script>
export default {
  data() {
    return {
      back: true,
      startX: 0,
      curentX: 0,
    };
  },
  methods: {
    touchstart(e) {
      this.startX = e.touches[0].pageX;
    },
    touchend(e) {
      this.curentX = e.changedTouches[0].clientX;
      if (this.curentX - this.startX > 50 && this.startX < 90) {
        if (
          this.$router.history.current.name &&
          this.$router.history.current.name != "workbench"
        ) {
          this.$router.go(-1);
        }
      }
    },
  },
};
</script>

<style lang="scss">
html,
body,
#app {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #f6f6f6;
  @apply select-none;
}
</style>
